<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-projects-settings-sharing.qdoc -->
  <title>Sharing Project Settings | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Sharing Project Settings</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-build-dependencies.html" />
  <link rel="next" href="creator-project-managing-sessions.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-build-dependencies.html">Specifying Dependencies</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-project-managing-sessions.html">Managing Sessions</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#creating-shared-settings-file">Creating Shared Settings File</a></li>
<li class="level1"><a href="#updating-shared-settings">Updating Shared Settings</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Sharing Project Settings</h1>
<span class="subtitle"></span>
<!-- $$$creator-sharing-project-settings.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt Creator stores user-specific project settings in a .pro.user file. You can share these settings between several projects as a .pro.shared file. It has the same XML structure as a .pro.user file, but only contains the settings to share.</p>
<a name="creating-shared-settings-file"></a>
<h2 id="creating-shared-settings-file">Creating Shared Settings File</h2>
<p>The easiest way to create a .pro.shared file is to copy settings from the .pro.user file. Typically, you would share some of the values in the <code>ProjectExplorer.Project.EditorSettings</code> section.</p>
<p><b>Note: </b>You must always specify the <code>ProjectExplorer.Project.Updater.FileVersion</code> variable and use the same value for it as in the .pro.user file.</p><p>You can then deliver the .pro.shared file to other developers or copy it to other development PCs.</p>
<p>The following is an example of a pro.shared file:</p>
<pre class="cpp">

  <span class="operator">&lt;</span><span class="operator">?</span>xml version<span class="operator">=</span><span class="string">&quot;1.0&quot;</span> encoding<span class="operator">=</span><span class="string">&quot;UTF-8&quot;</span><span class="operator">?</span><span class="operator">&gt;</span>
  <span class="operator">&lt;</span><span class="operator">!</span>DOCTYPE <span class="type">QtCreatorProject</span><span class="operator">&gt;</span>
  <span class="operator">&lt;</span>qtcreator<span class="operator">&gt;</span>
      <span class="operator">&lt;</span>data<span class="operator">&gt;</span>
          <span class="operator">&lt;</span>variable<span class="operator">&gt;</span>ProjectExplorer<span class="operator">.</span>Project<span class="operator">.</span>EditorSettings<span class="operator">&lt;</span><span class="operator">/</span>variable<span class="operator">&gt;</span>
          <span class="operator">&lt;</span>valuemap type<span class="operator">=</span><span class="string">&quot;QVariantMap&quot;</span><span class="operator">&gt;</span>
              <span class="operator">&lt;</span>value type<span class="operator">=</span><span class="string">&quot;bool&quot;</span> key<span class="operator">=</span><span class="string">&quot;EditorConfiguration.SpacesForTabs&quot;</span><span class="operator">&gt;</span><span class="keyword">true</span><span class="operator">&lt;</span><span class="operator">/</span>value<span class="operator">&gt;</span>
              <span class="operator">&lt;</span>value type<span class="operator">=</span><span class="string">&quot;bool&quot;</span> key<span class="operator">=</span><span class="string">&quot;EditorConfiguration.AutoSpacesForTabs&quot;</span><span class="operator">&gt;</span><span class="keyword">false</span><span class="operator">&lt;</span><span class="operator">/</span>value<span class="operator">&gt;</span>
              <span class="operator">&lt;</span>value type<span class="operator">=</span><span class="string">&quot;int&quot;</span> key<span class="operator">=</span><span class="string">&quot;EditorConfiguration.TabSize&quot;</span><span class="operator">&gt;</span><span class="number">14</span><span class="operator">&lt;</span><span class="operator">/</span>value<span class="operator">&gt;</span>
              <span class="operator">&lt;</span>value type<span class="operator">=</span><span class="string">&quot;int&quot;</span> key<span class="operator">=</span><span class="string">&quot;EditorConfiguration.IndentSize&quot;</span><span class="operator">&gt;</span><span class="number">4</span><span class="operator">&lt;</span><span class="operator">/</span>value<span class="operator">&gt;</span>
          <span class="operator">&lt;</span><span class="operator">/</span>valuemap<span class="operator">&gt;</span>
          <span class="operator">&lt;</span><span class="operator">/</span>data<span class="operator">&gt;</span>
      <span class="operator">&lt;</span>data<span class="operator">&gt;</span>
          <span class="operator">&lt;</span>variable<span class="operator">&gt;</span>ProjectExplorer<span class="operator">.</span>Project<span class="operator">.</span>Updater<span class="operator">.</span>FileVersion<span class="operator">&lt;</span><span class="operator">/</span>variable<span class="operator">&gt;</span>
          <span class="operator">&lt;</span>value type<span class="operator">=</span><span class="string">&quot;int&quot;</span><span class="operator">&gt;</span><span class="number">10</span><span class="operator">&lt;</span><span class="operator">/</span>value<span class="operator">&gt;</span>
      <span class="operator">&lt;</span><span class="operator">/</span>data<span class="operator">&gt;</span>
  <span class="operator">&lt;</span><span class="operator">/</span>qtcreator<span class="operator">&gt;</span>

</pre>
<a name="updating-shared-settings"></a>
<h2 id="updating-shared-settings">Updating Shared Settings</h2>
<p>The first time Qt Creator loads the project after you added pro.shared settings, it overwrites the pro.user settings with them. If you open the project for the first time and Qt Creator has not created a .pro.user file, the settings in the .pro.shared file take effect immediately.</p>
<p>If you receive a .pro.shared file and do not want to use a particular setting in it, you can change it. Qt Creator marks it a <i>sticky</i> setting. The next time you open a project, the setting is not updated. Qt Creator tracks sticky settings in the .pro.user file and removes the mark if the values in the pro.user and pro.shared files eventually become identical. This is to avoid a permanent sticky setting that was created just because you wanted to try something out.</p>
</div>
<!-- @@@creator-sharing-project-settings.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-build-dependencies.html">Specifying Dependencies</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-project-managing-sessions.html">Managing Sessions</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
